package com.jdpc.weparty.service.activity

import com.jdpc.weparty.entity.Activity
import com.jdpc.weparty.entity.ActivityType
import com.jdpc.weparty.entity.User
import com.sun.org.apache.xpath.internal.operations.Bool
import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable

interface ActivityService {
    /**
     * 发布活动
     * @param activityInfo 活动信息
     * @param publisher 发布者
     * @param examiner 审核人
     */
    fun publishActivity(activityInfo: ActivityInfo, publisher: User, examiner: User):Int

    /**
     * 修改活动信息
     */
    fun changeActivityInfo(aCode: String, activityInfo: ActivityInfo)
    fun changeActivityInfo(aId: Int, activityInfo: ActivityInfo)
    /**
     * 删除活动
     */
    fun deleteActivity(aCode: String)
    fun deleteActivity(aId: Int)

    /**
     * 管理员提交审核结果
     */
    fun examActivity(aCode: String, examined: Boolean?)
    fun examActivity(aId: Int, examined: Boolean?)

    /**
     * 获取所有活动
     */
    fun getAllActivity(): List<Activity>
    fun getAllActivity(pageable: Pageable): Page<Activity>?

    /**
     * 根据活动类型查找活动
     */
    fun findActivity(type: ActivityType): List<Activity>
    fun findActivity(type: ActivityType, pageable: Pageable): Page<Activity>

    /**
     * 根据活动名称查找活动
     */
    fun findActivity(name: String): List<Activity>
    fun findActivity(name: String, pageable: Pageable): Page<Activity>

    /**
     * 根据活动码查找活动
     */
    fun findActivityByCode(aCode: String): Activity

    /**
     * 根据活动主键查找活动
     */
    fun findActivity(id:Int):Activity?


    /**
     * 根据活动审核状态查找活动。
     * @param checked true->审核通过。 false->审核未通过
     */
    fun findActivity(checked: Boolean): List<Activity>
    fun findActivity(checked: Boolean, pageable: Pageable): Page<Activity>

    /**
     * 查找某一发布人发布的活动
     * @param checked 审核状态. null -> 未审核 . true -> 审核通过 . false -> 审核未通过
     */
    fun findActivityByPublisher(publisher: User,checked: Boolean?): List<Activity>
    fun findActivityByPublisher(publisher: User, pageable: Pageable): Page<Activity>
    fun findActivityByPublisher(publisher: User,checked: Boolean?, pageable: Pageable): Page<Activity>
    /**
     * 查找某一管理员的审核活动记录（ 审核过和待审核的活动）
     * @param checked 审核状态. null -> 未审核 . true -> 审核通过 . false -> 审核未通过
     */
    fun findActivityByExaminer(examiner: User, checked: Boolean?): List<Activity>
    fun findActivityByExaminer(examiner: User, checked: Boolean?, pageable: Pageable): Page<Activity>
}